package com.ruoyi.web.controller.system;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.SysPythonAddressEntity;
import com.ruoyi.system.service.IMpSysPythonAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  平台管理
 * </p>
 *
 * @author <a href="https://fengwenyi.com?fs=mpcg">Erwin Feng</a>
 * @since 2024-01-16
 */
@RestController
@RequestMapping("/monitor/pythonaddress")
public class SysPythonAddressController extends BaseController {
    @Autowired
    private IMpSysPythonAddressService iMpSysPythonAddressService;

    @GetMapping("/addressname")
    public AjaxResult getAddressNameById(Integer id){
        SysPythonAddressEntity sysPythonAddressEntity =  iMpSysPythonAddressService.getAddressById(id);
        return success(sysPythonAddressEntity);
    }
    @PostMapping("/save")
    public AjaxResult saveAndUpdateAddress(SysPythonAddressEntity sysPythonAddressEntity){
        return iMpSysPythonAddressService.saveAndUpdateAndDelAddress(sysPythonAddressEntity);
    }
    @Anonymous
    @GetMapping("/addressList")
    public TableDataInfo getAddressesList(Integer parentId,SysPythonAddressEntity sysPythonAddressEntity){

        return getDataTable(iMpSysPythonAddressService.getAddressesList(parentId,sysPythonAddressEntity));
    }

}
